package com.lingnan.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lingnan.mapper.ItineraryMapper;
import com.lingnan.pojo.Itinerary;
import com.lingnan.service.ItineraryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @Author 梁兴达
 * @Date 2022/3/22 19:50:09
 * @Version 1.0
 */
@Service
public class ItineraryServiceImpl extends ServiceImpl<ItineraryMapper, Itinerary> implements ItineraryService {

    @Autowired
    private ItineraryMapper itineraryMapper;

    @Override
    public List<Itinerary> selectByNo(String no) {
        ConcurrentHashMap hashMap = new ConcurrentHashMap();
        hashMap.put("no",no);
        return itineraryMapper.selectByMap(hashMap);
    }

    @Override
    public Integer deleteByNoAndId(Integer id, String no) {
        ConcurrentHashMap hashMap = new ConcurrentHashMap();
        hashMap.put("id",id);
        hashMap.put("no",no);
        return itineraryMapper.deleteByMap(hashMap);
    }
}
